const accountInfo = wx.getAccountInfoSync();
const env = accountInfo.miniProgram.envVersion;
const app = getApp();

const baseApi = {
  develop: {
    baseUrl: 'http://localhost:9500/',
  },
  trial: {
    baseUrl: 'http://140.143.235.67:9500/',
  },
  release: {
    baseUrl: "https://xxxx.com"
  }
};

const apiBase = baseApi[env];
console.log(__wxConfig.envVersion,"__wxConfig.envVersion 是一个可以用来判断当前小程序运行的环境变量。它的值通常为 develop, trial, 或者 release");
const {baseUrl} = apiBase;
app.globalData.BaseUrl = baseUrl;

export default apiBase;